/* 
 * Szkeleton.java
 *
 * Created on March 25, 2007, 3:14 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package fmglemmings;

import java.io.*;
import java.lang.Integer;

/**
 *
 * @author ijanos
 */
public class Szkeleton {
	public void startgame(){
		System.out.println("Start Game use case indul");
		new GameField();
		System.out.println("Start Game use case lefutott");
	}
	public void swaplemming(){
		boolean exit=true;
		System.out.println("---Lemming cserelo (eszkozado) use case indul");
		System.out.println("A gamefield letrehozza az uj tipusu lemminget.\nLemming tipusa:");
		Menu m = new Menu();
		String[] lemmingek = {
				"Blokker",
				"Robbano",
				"Epito",
				"Repulo",
				"Furo",
				"Normal"
			};
			switch(m.menu(lemmingek)){
				case 0: new BlockerLemming();
					break;
				case 1:	new BombLemming();
					break;
				case 2:	new BuilderLemming();
					break;
				case 3:	new FlyingLemming();
					break;
				case 4:	new DiggerLemming();
					break;
				case 5:	new Lemming();
					break;
				default: break;
			}
		new Envelope().setObject();
		System.out.println("---Lemming cserelo use case vegzett");
	}
	public void lemmingfalls(){
		System.out.println("---Lemming leesik usecase\nszukseges objektumok letrehozasa");
                GameField gf = new GameField();
		Envelope e1 = new Envelope();
		Lemming l1 = new Lemming();
                Stone s1= new Stone();
		System.out.println("A lemming mozgatasa; alatta levo boritek kikeresese.");
		e1.setX(); e1.setY();
		e1.getX(); e1.getY();
                e1.getObject();	
                s1.hasTop();
		Menu m = new Menu();
                System.out.println("Alatta levo elem vizsgalata, van e teteje");
		String[] winm = {
				"Nincs teteje",
				"Van teteje"
			};
		switch(m.menu(winm)){
			case 0: System.out.println("Lemming tipusa?");
                                Menu n = new Menu();
                                String[] lemmingek = {
                                    "Epito",
                                    "Repulo",
                                    "Egyeb"
                                   };
                                switch(n.menu(lemmingek)){
                                    case 0: l1 = new BuilderLemming();
					break;
                                    case 1: l1 = new FlyingLemming();
					break;
                                    default: break;
                                }
                                l1.fallEvent();
				break;
			case 1:	System.out.println("A lemming folytatja utjat...");
				break;
			default: break;
		}
		System.out.println("---A Lemming leesik use case lefutott");
	}
	public void lemminglands(){
                System.out.println("---Lemming foldeter usecase\nszukseges objektumok letrehozasa");
                GameField gf = new GameField();
		Envelope e1 = new Envelope();
		Lemming l1 = new Lemming();
                Stone s1= new Stone();
		System.out.println("A lemming mozgatasa; alatta levo boritek kikeresese.");
		e1.setY();  //mivel eddig esett, csak lefel� kell mozgatni
		e1.getX(); e1.getY();   //alatta levo boritek megkeresese, lekerdezese
                e1.getObject();	
                s1.hasTop();
		Menu m = new Menu();
                System.out.println("Alatta levo elem vizsgalata, van e teteje");
		String[] winm = {
				"Van teteje",
				"Nincs teteje"
			};
		switch(m.menu(winm)){
			case 0: System.out.println("Lemming tipusa?");
                                Menu n = new Menu();
                                String[] lemmingek = {
                                    "Repulo",
                                    "Egyeb"
                                   };
                                switch(n.menu(lemmingek)){
                                    case 0: l1=	new FlyingLemming();
                                            l1.fallenEvent();
                                            System.out.println("Lemming folytatja utjat");
					break;
                                    case 1: l1.fallenEvent();
                                            Menu k=new Menu();
                                            System.out.println("Milyen magasrol esett?");
                                            String[] magassag={
                                                "<4",
                                                ">4"
                                            };
                                            switch(k.menu(magassag)){
                                                case 0: System.out.println("Lemming folytatja az utjat");
                                                case 1: gf.dieRequest();
                                            }
					break;
                                    default: break;
                                }
				break;
			case 1:	System.out.println("A lemming esik tov�bb");
				break;
			default: break;
		}
		System.out.println("---A Lemming foldeter use case lefutott");
	}
	public void lemmingbuilds(){
		System.out.println("---Lemming epit usecase\nszukseges objektumok letrehozasa");
		Lemming l1 = new BuilderLemming();
		Envelope e1 = new Envelope();
		GameField gf = new GameField();	
		Stone s1 = new Stone();
		System.out.println("Lemming mozgatasa, alatta levo boritek kikerese");
		e1.setX();e1.setY();
		e1.getX();e1.getY();
		e1.getObject();	
		s1.hasTop();
		Menu m = new Menu();
		String[] fallm = {
				"Nincs teteje",
				"Van teteje"
			};
		switch(m.menu(fallm)){
			case 0: gf.buildRequest();
				new Stone();
				new Envelope();
				break;
			case 1:	System.out.println("A lemming folytatja utjat...");
				break; 
			default: break;
		}			
		System.out.println("---Lemming epit use case vegzett");		
	}
	public void lemmingturns(){
		System.out.println("---Lemming megfordul usecase\nszukseges objektumok letrehozasa");
		Lemming l1 = new Lemming();
		Envelope e1 = new Envelope();
		GameField gf = new GameField();	
		System.out.println("Lemming mozgatasa, utkozes vizsgalata");
		e1.setX();e1.setY();
		e1.getX();e1.getY();
		e1.getObject();	
		l1.hitEvent();
		Menu m = new Menu();
		String[] turnm = {
				"Blokkolo elem van utban",
				"Nem blokkolo elem van utban"
			};
		switch(m.menu(turnm)){
			case 0: gf.turnRequest();
				break;
			case 1:	System.out.println("A lemming folytatja utjat...");
				break; 
			default: break;
		}			
		System.out.println("---Lemming megfordul use case vegzett");
	}
	public void lemmingdigs(){
		System.out.println("---Lemming alagutat as use case\nszukseges objektumok letrehozasa");
		Lemming l1 = new DiggerLemming();
		Envelope e1 = new Envelope();
		GameField gf = new GameField();	
		System.out.println("Lemming mozgatasa, utkozes vizsgalata");
		e1.setX();e1.setY();
		e1.getX();e1.getY();
		e1.getObject();	
		l1.hitEvent();
		Menu m = new Menu();
		String[] digm = {
				"Elpusztithato elem van utban",
				"Nem elpusztithato elem van utban"
			};
		switch(m.menu(digm)){
			case 0: gf.removeRequest();
				break;
			case 1:	gf.turnRequest();
				break;
			default: break;
		}			
		System.out.println("---Lemming alagutat as use case lefutott");
	}
	public void lemmingblowups(){
		System.out.println("---Robbano lemming use case indul\nSzukseges objektumok letrehozasa");
		Lemming l1 = new Lemming();
		Stone s1 = new Stone();
		Envelope e1 = new Envelope();
		GameField gf = new GameField();
		System.out.println("Robbano lemming szamlaloja lejart");
		gf.boomRequest();
		System.out.println("Kornyegzo boritekok megkeresese, bennuk tarolt objektum lekerese");
		e1.getX();e1.getY();
		e1.getObject();
		Menu m = new Menu();
		String[] boomm = {
				"Lemming tartozkodik a szomszedos mezon",
				"Ko van a szomszedos mezon"
			};
		switch(m.menu(boomm)){
			case 0: l1.bombEvent();
				gf.dieRequest();
				break;
			case 1:	s1.bombEvent();
				gf.dieRequest();
				break;
			default: break;
		}		
		System.out.println("---Robbano lemming use case vegzett");
	}
	public void lemmingwins(){
		System.out.println("---Lemming celba er usecase\nUsecasehez szukseges objektumok letrehozasa");
		GameField gf = new GameField();
		Envelope e1 = new Envelope();
		Lemming l1 = new Lemming();
		System.out.println("A lemming mozgatasa; Szomszedos boritek kikeresese.");
		e1.setX(); e1.setY();
		e1.getX(); e1.getY();
		l1.hitEvent();
		Menu m = new Menu();
		String[] winm = {
				"Cellal utkozik",
				"Nem utkozik"
			};
		switch(m.menu(winm)){
			case 0: gf.winRequest();
				break;
			case 1:	System.out.println("A lemming folytatja utjat...");
				break;
			default: break;
		}
		System.out.println("---A Lemming celba er use case legutott");
	}
	/** Szkeleton konstruktor */
	public Szkeleton() {
		int input;
		while(true){
			System.out.println("::FMG-Lemmings::\nMain Menu");
			String[] mainmenu = {
				"Start New Game",
				"Swap lemming",
				"Lemming falls",
				"Lemming lands",
				"Lemming builds",
				"Lemming turns",
				"Lemming digs",
				"Lemming blows up",
				"Lemming wins"
			};
			Menu m = new Menu();
			switch(m.menu(mainmenu)){
				case 0: startgame();
					break;
				case 1:	swaplemming();
					break;
				case 2: lemmingfalls();
					break;
				case 3: lemminglands();
					break;
				case 4: lemmingbuilds();
					break;
				case 5:	lemmingturns();
					break;
				case 6:	lemmingdigs();
					break;
				case 7: lemmingblowups();
					break;
				case 8:	lemmingwins();
					break;
				default: System.exit(0); 
					break;
			}
		}
		
	}
	
}
